[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
clock() Number of Clock Ticks Since Execution Started
#include <time.h>
clock_t clock(void);
This function returns the processor time used since the beginning
of the program as measured in clock ticks. You can divide the
return value by the constant CLK_TCK to convert to seconds.
Returns: Processor time since starting the program (in
clock tics).
Notes: Divide by CLK_TCK to get seconds.
-------------------------------- Example ---------------------------------
#include <time.h>
#include <stdio.h>
#include <dos.h>
int main(void)
clock_t my_start, my_end;
my_start = clock();
{...do work...}
my_end = clock();
printf("Work took %f", my_end - my_start, "clock ticks.\n");
return 0;
See Also:
time()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson